package cn.com.project.pattern.e.factory;

/**
 * 4、女娲造人工厂
 */
public class HumanFactory {
    public static Human createHuman(Class c) {
        Human human = null;
        try {
            // 产生一个人类
            human = (Human) Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return human;
    }
}
